#ifndef ABSTRACTMOTOR_H
#define ABSTRACTMOTOR_H

class AbstractMotor;

#include <QThread>
#include <QTimer>
#include <QDebug>

class AbstractMotor : public QThread
{
    Q_OBJECT

public:
    AbstractMotor(int interval):QThread(){
        timer = new QTimer(0);
        timer->setInterval(interval);
        connect(timer,SIGNAL(timeout()), this, SLOT(update()));
    }

    virtual void setConsign(double cons)=0;
    virtual double getState()=0;
    virtual void setState(double s)=0;

    virtual void run(){
        exec();
    }

public slots:
    virtual void update()=0;

protected:
    QTimer *timer;
};

#endif // ABSTRACTMOTOR_H
